using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class Risk_factors_detailMap : EntityTypeConfiguration<Risk_factors_detail>
    {
        public Risk_factors_detailMap()
        {
            // Primary Key
            this.HasKey(t => t.Risk_factors_detail_id);

            // Properties
            this.Property(t => t.Patient_id)
                .HasMaxLength(20);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.update_by)
                .HasMaxLength(20);

            this.Property(t => t.HDL_C_Unit)
                .HasMaxLength(1);

            this.Property(t => t.LDL_C_Unit)
                .HasMaxLength(1);

            this.Property(t => t.TC_Unit)
                .HasMaxLength(1);

            this.Property(t => t.TG_Unit)
                .HasMaxLength(1);

            this.Property(t => t.Statin)
                .HasMaxLength(20);

            this.Property(t => t.Other_tune_lipids)
                .HasMaxLength(20);

            this.Property(t => t.Fasting_glucose_Unit)
                .HasMaxLength(1);

            this.Property(t => t.Postprandial_2H_Blood_sugar_Unit)
                .HasMaxLength(1);

            this.Property(t => t.Insulin)
                .HasMaxLength(20);

            this.Property(t => t.Sulfonylureas)
                .HasMaxLength(20);

            this.Property(t => t.Thiazolidinedione_derivatives)
                .HasMaxLength(20);

            this.Property(t => t.Biguanides)
                .HasMaxLength(20);

            this.Property(t => t.Glucosidase_inhibitors)
                .HasMaxLength(20);

            this.Property(t => t.Insulin_sensitizers)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("Risk_factors_detail");
            this.Property(t => t.Risk_factors_detail_id).HasColumnName("Risk_factors_detail_id");
            this.Property(t => t.Patient_id).HasColumnName("Patient_id");
            this.Property(t => t.Follow_up_id).HasColumnName("Follow_up_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.update_time).HasColumnName("update_time");
            this.Property(t => t.update_by).HasColumnName("update_by");
            this.Property(t => t.blood_pressure_measuring_date).HasColumnName("blood_pressure_measuring_date");
            this.Property(t => t.SBP).HasColumnName("SBP");
            this.Property(t => t.DBP).HasColumnName("DBP");
            this.Property(t => t.HR).HasColumnName("HR");
            this.Property(t => t.HDL_C).HasColumnName("HDL_C");
            this.Property(t => t.HDL_C_Unit).HasColumnName("HDL_C_Unit");
            this.Property(t => t.LDL_C).HasColumnName("LDL_C");
            this.Property(t => t.LDL_C_Unit).HasColumnName("LDL_C_Unit");
            this.Property(t => t.TC).HasColumnName("TC");
            this.Property(t => t.TC_Unit).HasColumnName("TC_Unit");
            this.Property(t => t.TG).HasColumnName("TG");
            this.Property(t => t.TG_Unit).HasColumnName("TG_Unit");
            this.Property(t => t.Statin).HasColumnName("Statin");
            this.Property(t => t.Other_tune_lipids).HasColumnName("Other_tune_lipids");
            this.Property(t => t.Fasting_glucose).HasColumnName("Fasting_glucose");
            this.Property(t => t.Fasting_glucose_Unit).HasColumnName("Fasting_glucose_Unit");
            this.Property(t => t.Postprandial_2H_Blood_sugar).HasColumnName("Postprandial_2H_Blood_sugar");
            this.Property(t => t.Postprandial_2H_Blood_sugar_Unit).HasColumnName("Postprandial_2H_Blood_sugar_Unit");
            this.Property(t => t.Insulin).HasColumnName("Insulin");
            this.Property(t => t.Sulfonylureas).HasColumnName("Sulfonylureas");
            this.Property(t => t.Thiazolidinedione_derivatives).HasColumnName("Thiazolidinedione_derivatives");
            this.Property(t => t.Biguanides).HasColumnName("Biguanides");
            this.Property(t => t.Glucosidase_inhibitors).HasColumnName("Glucosidase_inhibitors");
            this.Property(t => t.Insulin_sensitizers).HasColumnName("Insulin_sensitizers");
        }
    }
}
